package com.example.gymmanagebackend.service.impl;

import com.example.gymmanagebackend.mapper.EquipmentMapper;
import com.example.gymmanagebackend.pojo.Equipment;
import com.example.gymmanagebackend.service.EquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class EquipmentServiceImpl implements EquipmentService {

    @Autowired
    private EquipmentMapper equipmentMapper;

    @Override
    public int addEquipment(Equipment equipment) {
        return equipmentMapper.addEquipment(equipment);
    }

    @Override
    public int deleteEquipmentById(int id) {
        return equipmentMapper.deleteEquipmentById(id);
    }

    @Override
    public int updateEquipment(Equipment equipment) {
        return equipmentMapper.updateEquipment(equipment);
    }

    @Override
    public List<Equipment> getAllEquipments() {
        return equipmentMapper.getAllEquipments();
    }

    public List<Equipment> findEquipmentByName(String name) {
        return equipmentMapper.findEquipmentByName(name);
    }
    @Override
    public List<Equipment> getEquipmentQuantity() {
        return equipmentMapper.getEquipmentQuantity();
    }
}